package com.qs.config.ossconfig;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: OSSClient
 * Package: com.sixkey.config
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2023/9/3 - 15:20
 * @Version: v1.0
 */
@Configuration
public class OSSClient implements InitializingBean {

    @Value("${oss.endpoint}")
    private String endpoint;

    @Value("${oss.accessKey}")
    private String accessKey;

    @Value("${oss.secretKey}")
    private String secretKey;

    @Value("${oss.bucketName}")
    private String bucketName;

    public static String ENDPOINT;
    public static String ACCESS_KEY;
    public static String SECRET_KEY;
    public static String BUCKET_NAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        OSSClient.ENDPOINT = this.endpoint;
        OSSClient.ACCESS_KEY = this.accessKey;
        OSSClient.SECRET_KEY = this.secretKey;
        OSSClient.BUCKET_NAME = this.bucketName;
    }
}
